package com.shop2cn.iapi.wxcomponent.parameter;

/**
 * @ClassName :InfoTypeEnum
 * @Author :MrCao
 * @Description : todo
 * @Date : Create in 17:30 2019/12/9
 * @Modified BY:
 */
public enum InfoTypeEnum {
    COMPONENT_VERIFY_TICKET(0,"component_verify_ticket","验证票据"),
    AUTHORIZED(1,"authorized","授权成功"),
    UNAUTHORIZED(2,"unauthorized","取消授权"),
    UPDATEAUTHORIZED(3,"updateauthorized","授权更新")
    ;


    private int code;
    private String value;
    private String message;

    InfoTypeEnum(int code, String value, String message) {
        this.code = code;
        this.value = value;
        this.message = message;
    }

    /**
     * 通过代值获取枚举项
     *
     * @param value
     * @return
     */
    public static InfoTypeEnum getByValue(String value) {
        for (InfoTypeEnum infoTypeEnum : InfoTypeEnum.values()) {
            if (infoTypeEnum.getValue().equals(value.trim())) {
                return infoTypeEnum;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
